package com.liachen.stock.controller.req;

import cn.hutool.core.date.DateUtil;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * @author Administrator
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class QueryStockSummaryReq implements Serializable {
    private Date startDate;
    private String buyDate;
    /**
     * 排序字段
     */
    private String orderBy;
    /**
     * 查询条数
     */
    private Integer num;

    public Date getBuyDate() {
        if (StringUtils.isNotEmpty(this.buyDate)) {
            return DateUtil.parseDate(this.buyDate);
        }
        return null;
    }
}
